﻿using System.Data.Common;
using Abp.EntityFramework;
using System.Data.Entity;
using RMM.Core.Entity.Users;
using Abp.Zero.EntityFramework;
using RMM.Authorization.Tenants;
using RMM.Authorization.Roles;
using RMM.Core.Entity.Cates;
using RMM.Core.Entity.Orders;
using RMM.Core.Entity.Shops;
using RMM.Core.Entity.Evaluates;
using RMM.Core.Entity.Areas;
using RMM.Core.Entity.Massagistes;

namespace RMM.EntityFramework
{
    public class RMMDbContext : AbpZeroDbContext<Tenant, Role, User>
    {
        //TODO: Define an IDbSet for each Entity...
        public virtual IDbSet<Categories> Categorie { get; set; }

        public virtual IDbSet<Order> Orders { get; set; }

        public virtual IDbSet<OrderItems> OrderItem { get; set; }

        //public virtual IDbSet<User> User { get; set; }

        public virtual IDbSet<UserExtend> UserExtend { get; set; }

        public virtual IDbSet<Shop> Shop { get; set; }

        public virtual IDbSet<ShopProject> ShopProject { get; set; }

        public virtual IDbSet<Evaluate> Evaluates { get; set; }
        
        public virtual IDbSet<EvaluateCate> EvaluateCates { get; set; }

        public virtual IDbSet<AreaCity> AreaCities { get; set; }

        public virtual IDbSet<Massagist> Massagists { get; set; }

        public virtual IDbSet <MassagistExtend> MassagistExtends { get; set; }

        public virtual IDbSet<MassagistShare> MassagistShares { get; set; }

        public virtual IDbSet<MassagistProject> MassagistProjects { get; set; }









        /* NOTE: 
         *   Setting "Default" to base class helps us when working migration commands on Package Manager Console.
         *   But it may cause problems when working Migrate.exe of EF. If you will apply migrations on command line, do not
         *   pass connection string name to base classes. ABP works either way.
         */
        public RMMDbContext()
            : base("Default")
        {

        }

        /* NOTE:
         *   This constructor is used by ABP to pass connection string defined in RMMDataModule.PreInitialize.
         *   Notice that, actually you will not directly create an instance of RMMDbContext since ABP automatically handles it.
         */
        public RMMDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {

        }

        //This constructor is used in tests
        public RMMDbContext(DbConnection existingConnection)
         : base(existingConnection, false)
        {

        }

        public RMMDbContext(DbConnection existingConnection, bool contextOwnsConnection)
         : base(existingConnection, contextOwnsConnection)
        {

        }
    }
}
